<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- <script src="./jquery-1.12.4.min.js"></script> -->
<!-- <script src="../../jquery-1.12.4.min.js"></script> -->


<!-- file:///D:/a-jinsi-courseware/1.class%20course/3.%20W2107A/5.jQuery/jquery2107/pcToyidong/pc.html  本地路径

file协议
http://127.0.0.1:5500/pcToyidong/pc.html
live Server  帮你启动了一个服务器 

-->
<!-- <script src="../../test/jquery-1.12.4.min.js"></script> -->
<script src="./jquery-1.12.4.min.js"></script>

<body>
    <h1>这是pc页面</h1>
    <script>
        console.log($);
        function browserRedirect() {
            var sUserAgent = navigator.userAgent.toLowerCase();
            console.log(navigator.userAgent);
            var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
            var bIsMidp = sUserAgent.match(/midp/i) == "midp";
            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
            var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
            var bIsAndroid = sUserAgent.match(/android/i) == "android";
            var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
            var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                //跳转移动端页面
                window.location = './yidong.html';
            }
        }
        browserRedirect();
    </script>
</body>

</html>